<template>
  <!-- 科室医师工作量 -->
  <div>
    <h1>门诊分科医师工作量统计表</h1>
    <h3>时期:{{startDate}} ～ {{endDate}}</h3>
    <h2>医院名称：</h2>
    <el-table :data="tableData" stripe border style="width: 100%">
      <el-table-column prop="kbjc" label="科别" align="center" width></el-table-column>
      <el-table-column prop="tjm1ysdm" label="医师" align="center" width></el-table-column>
      <el-table-column prop="tjm1yszc" label="职称" align="center" width></el-table-column>
      <el-table-column prop="tjm1001" label="工时" align="center" width></el-table-column>
      <el-table-column label="门诊人次" align="center">
        <el-table-column prop="tjm1002" label="小计" align="center" width></el-table-column>
        <el-table-column prop="tjm1008" label="专科" align="center" width></el-table-column>
        <el-table-column prop="tjm1009" label="专家" align="center" width></el-table-column>
      </el-table-column>
      <el-table-column prop="tjm1003" label="急诊人次" align="center" width></el-table-column>
      <el-table-column prop="tjm1004" label="单项健康检查" align="center" width></el-table-column>
      <el-table-column prop="tjm1005" label="手术例数" align="center" width></el-table-column>
      <el-table-column prop="tjm1006" label="会诊人次" align="center" width></el-table-column>
      <el-table-column prop="tjm1007" label="出诊人次" align="center" width></el-table-column>
    </el-table>
  </div>
</template>

<script>
import { outPatientWorkAmount } from "@/api";
import { showOkMsg, showErrorMsg } from "@/utils/index.js";

export default {
  data() {
    return {
      tableData: [],
      startDate: "",
      endDate: ""
    };
  },
  created() {
    this.getTableList();
  },
  props: ["dateList"],
  methods: {
    getTableList() {
      if (this.dateList.dateEnd && this.dateList.dateBegin) {
        outPatientWorkAmount({
          startTime: this.dateList.dateBegin,
          endTime: this.dateList.dateEnd
        }).then(res => {
          if (res.code === 0) {
            showOkMsg(res.msg);
            this.startDate = this.dateList.dateBegin;
            this.endDate = this.dateList.dateEnd;
            this.tableData = res.data;
          }
        });
      } else {
        showErrorMsg("请选择开始或结束日期");
      }
    }
  }
};
</script>

<style scoped>
h1 {
  font-size: 24px;
  text-align: center;
  padding: 23px 0;
}
h3 {
  text-align: center;
  padding-bottom: 20px;
}
h2 {
  padding: 4px 0;
  display: flex;
  justify-content: space-between;
}
</style>